package bb.lanxing.model.json;

import android.os.Parcel;
import android.os.Parcelable;
//import com.easemob.chat.core.C2441e;
import bb.lanxing.util.JsonUtil;
import bb.lanxing.util.MedalUtil;
import java.io.Serializable;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class RankUserDetail implements Serializable, Parcelable {
    public static final Parcelable.Creator<RankUserDetail> CREATOR = new Parcelable.Creator<RankUserDetail>() {
        @Override
        public RankUserDetail createFromParcel(Parcel source) {
            return new RankUserDetail(source);
        }

        @Override
        public RankUserDetail[] newArray(int size) {
            return new RankUserDetail[size];
        }
    };
    private int age;
    private String avatar;
    private String cityName;
    private long hots;
    private int level;
    private String licenseNumberColor;
    private String licenseNumberSkin;
    private String mainTeam;
    private String medalSmall;
    private int miles;
    private String plateNum;
    private String proName;
    private String provinceName;
    private int rank;
    private int sex;
    private List<UserAvatarMedal> userAvatarMedals;
    private long userId;
    private String userName;

    @Override
    public int describeContents() {
        return 0;
    }

    public RankUserDetail() {
    }

    public RankUserDetail(JSONObject node) throws JSONException {
        JSONArray arrayValue;
        setUserName(JsonUtil.getStringValue("userName", node));
        setSex(JsonUtil.getIntegerValue("sex", node));
        setAvatar(JsonUtil.getStringValue("avatar", node));
        setAge(JsonUtil.getIntegerValue("age", node));
        setUserId(JsonUtil.getLongValue("userId", node));
        setRank(JsonUtil.getIntegerValue("rank", node));
        setHots(JsonUtil.getLongValue("hots", node));
        setMiles(JsonUtil.getIntegerValue("miles", node));
        setLevel(JsonUtil.getIntegerValue("level", node));
        setLicenseNumberColor(JsonUtil.getStringValue("licenseNumberColor", node));
        setLicenseNumberSkin(JsonUtil.getStringValue("licenseNumberSkin", node));
        if (node.has("medalSmall") && (arrayValue = JsonUtil.getArrayValue("medalSmall", node)) != null) {
            List<UserAvatarMedal> userAvatorMedalInfo = MedalUtil.getUserAvatorMedalInfo(arrayValue);
            if (userAvatorMedalInfo != null) {
                String str = "";
                for (int i = 0; i < userAvatorMedalInfo.size(); i++) {
                    str = i == userAvatorMedalInfo.size() - 1 ? str + userAvatorMedalInfo.get(i).getUrl() : str + userAvatorMedalInfo.get(i).getUrl() + ";";
                }
                setMedalSmall(str);
            } else {
                setMedalSmall(null);
            }
            setUserAvatarMedals(userAvatorMedalInfo);
        }
        setCityName(JsonUtil.getStringValue("cityName", node));
        setProvinceName(JsonUtil.getStringValue("provinceName", node));
        setMainTeam(JsonUtil.getStringValue("mainTeam", node));
        setPlateNum(JsonUtil.getStringValue("plateNum", node));
        setProName(JsonUtil.getStringValue("proName", node));
    }

    public String getLicenseNumberSkin() {
        return this.licenseNumberSkin;
    }

    public void setLicenseNumberSkin(String licenseNumberSkin) {
        this.licenseNumberSkin = licenseNumberSkin;
    }

    public String getLicenseNumberColor() {
        return this.licenseNumberColor;
    }

    public void setLicenseNumberColor(String licenseNumberColor) {
        this.licenseNumberColor = licenseNumberColor;
    }

    public String getProName() {
        return this.proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public void setPlateNum(String plateNum) {
        this.plateNum = plateNum;
    }

    public String getPlateNum() {
        return this.plateNum;
    }

    public void setMainTeam(String mainTeam) {
        this.mainTeam = mainTeam;
    }

    public String getMainTeam() {
        return this.mainTeam;
    }

    public String getUserName() {
        return this.userName;
    }

    public long getUserId() {
        return this.userId;
    }

    public int getRank() {
        return this.rank;
    }

    public int getSex() {
        return this.sex;
    }

    public int getMiles() {
        return this.miles;
    }

    public long getHots() {
        return this.hots;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public int getAge() {
        return this.age;
    }

    public String getMedalSmall() {
        return this.medalSmall;
    }

    public int getLevel() {
        return this.level;
    }

    public String getCityName() {
        return this.cityName;
    }

    public String getProvinceName() {
        return this.provinceName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public void setMiles(int miles) {
        this.miles = miles;
    }

    public void setHots(long hots) {
        this.hots = hots;
    }

    public void setAvatar(String avator) {
        this.avatar = avator;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setMedalSmall(String medalSmall) {
        this.medalSmall = medalSmall;
    }

    public List<UserAvatarMedal> getUserAvatarMedals() {
        return this.userAvatarMedals;
    }

    public void setUserAvatarMedals(List<UserAvatarMedal> userAvatarMedals) {
        this.userAvatarMedals = userAvatarMedals;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.userName);
        dest.writeLong(this.userId);
        dest.writeInt(this.rank);
        dest.writeInt(this.sex);
        dest.writeInt(this.miles);
        dest.writeLong(this.hots);
        dest.writeString(this.avatar);
        dest.writeInt(this.age);
        dest.writeString(this.medalSmall);
        dest.writeTypedList(this.userAvatarMedals);
        dest.writeInt(this.level);
        dest.writeString(this.cityName);
        dest.writeString(this.provinceName);
        dest.writeString(this.mainTeam);
        dest.writeString(this.plateNum);
        dest.writeString(this.proName);
        dest.writeString(this.licenseNumberColor);
        dest.writeString(this.licenseNumberSkin);
    }

    protected RankUserDetail(Parcel in2) {
        this.userName = in2.readString();
        this.userId = in2.readLong();
        this.rank = in2.readInt();
        this.sex = in2.readInt();
        this.miles = in2.readInt();
        this.hots = in2.readLong();
        this.avatar = in2.readString();
        this.age = in2.readInt();
        this.medalSmall = in2.readString();
        this.userAvatarMedals = in2.createTypedArrayList(UserAvatarMedal.CREATOR);
        this.level = in2.readInt();
        this.cityName = in2.readString();
        this.provinceName = in2.readString();
        this.mainTeam = in2.readString();
        this.plateNum = in2.readString();
        this.proName = in2.readString();
        this.licenseNumberColor = in2.readString();
        this.licenseNumberSkin = in2.readString();
    }
}
